#include "TrueText/Config.h"
#include "TrueText/Alignment.h"

namespace TrueText {

// Boilerplate... :( Isn't even worth watching.

Alignment::Alignment()
	: valign(VA_TOP)
	, halign(HA_LEFT)
	// I've warned that every user should supply valid clipping rectangle
	, clipping(0, 0, 100, 100)
{ }

Alignment::Alignment(Rectangle clipping)
	: valign(VA_TOP)
	, halign(HA_LEFT)
	, clipping(clipping)
{ }

Alignment::Alignment(const Alignment& rhs)
	: valign(rhs.valign)
	, halign(rhs.halign)
	, clipping(rhs.clipping)
{ }

const Alignment& Alignment::operator=(const Alignment& rhs)
{
	if (this == &rhs)
		return *this;

	valign = rhs.valign;
	halign = rhs.halign;
	clipping = rhs.clipping;

    return *this;
}

VerticalAlignment Alignment::GetVerticalAlignment() const
{
	return valign;
}

void Alignment::SetVerticalAlignment(VerticalAlignment value)
{
	valign = value;
}

HorizontalAlignment Alignment::GetHorizontalAlignment() const
{
	return halign;
}

void Alignment::SetHorizontalAlignment(HorizontalAlignment value)
{
	halign = value;
}

const Rectangle& Alignment::GetClipping() const
{
	return clipping;
}

void Alignment::SetClipping(const Rectangle& value)
{
	clipping = value;
}

}